package com.billy.ohos.swipe.demo.util;

import com.billy.ohos.swipe.internal.LogUtil;
import com.ryan.ohos.extension.event.impl.ViewGroupHelper;
import com.ryan.ohos.extension.event.interfaces.ViewGroup;
import ohos.agp.components.AttrSet;
import ohos.agp.components.Component;
import ohos.agp.components.ListContainer;
import ohos.app.Context;
import ohos.multimodalinput.event.TouchEvent;

public class ConsumeListContainer  extends  ListContainer implements ViewGroup, Component.TouchEventListener  {


    private ViewGroupHelper viewGroupHelper;

    public ConsumeListContainer(Context var1) {
        this(var1, (AttrSet)null);
    }

    public ConsumeListContainer(Context var1, AttrSet var2) {
        this(var1, var2, (String)null);
    }

    public ConsumeListContainer(Context var1, AttrSet var2, String var3) {
        super(var1, var2, var3);
        setTouchEventListener(this);
        viewGroupHelper = new ViewGroupHelper(this);
    }

    @Override
    public void requestDisallowInterceptTouchEvent(boolean b) {
        viewGroupHelper.requestDisallowInterceptTouchEvent(b);
    }

    @Override
    public boolean onInterceptTouchEvent(TouchEvent touchEvent) {
        return false;
    }

    @Override
    public boolean dispatchTouchEvent(TouchEvent touchEvent) {
        return viewGroupHelper.dispatchTouchEvent(touchEvent);
    }

    @Override
    public boolean onTouchEvent(TouchEvent touchEvent) {
        return true;
    }


    @Override
    public boolean isConsumed() {
        return viewGroupHelper.isConsumed();
    }

    @Override
    public boolean onTouchEvent(Component component, TouchEvent touchEvent) {
        LogUtil.loge("wrapper388888", "onTouchEvent2222222  + onInterceptTouchEvent55555555" );
        return false;
    }
}